{% block body %}
<script type="text/javascript" src="{{ asset('bundles/rtscraftmain/js/ajax.js') }}"></script>
<script type="text/javascript" src="{{ asset('bundles/rtscraftmain/js/ckeditor/ckeditor.js') }}"></script>

<div id="history">
  {% if title is not defined %}
  <form method="post" name="editform">
    {% else %}
    <form method="post" name="editform">
      {% endif %}

      {% if title is defined %}
      <label>Titre :</label><input type="text" name="title" value="{{title}}" readonly />
      {% else %}
      <label>Titre :</label><input type="text" name="title" />
      {% endif %}
      <p>
	{% if text is defined %}
	<textarea id="editor1" name="editor1">{{text}}</textarea>
	{% else %}
	<textarea id="editor1" name="editor1"></textarea>
	{% endif %}
	<script type="text/javascript">
	  if(CKEDITOR.instances['editor1'])
	  {
	  delete CKEDITOR.instances['editor1'];
	  }
	  CKEDITOR.replace('editor1');
	</script>
      </p>
      <p>
	{% if title is not defined %}
	<input type="submit" onclick="submitForm('post')" />
	{% else %}
	<input type="submit" onclick="submitForm('editpost')" />
	{% endif %}
      </p>
    </form>
</div>
{% endblock %}
